Fix Ghostty session restore launch path#1976
Conversation
Use Ghostty's shell execution path instead of injecting raw terminal input so Claude resume commands run reliably when opening a session terminal. Co-Authored-By: Claude Opus 4.6 <[email protected]>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a179c60ca7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| fn launch_ghostty(command: &str, cwd: Option<&str>) -> Result<(), String> { | ||
| let args = build_ghostty_args(command, cwd); | ||
| let full_command = build_shell_command(command, cwd); |
There was a problem hiding this comment.
Avoid shell-expanding cwd in Ghostty launch
launch_ghostty now feeds cwd through build_shell_command and runs it via -c, which turns the path into shell-parsed text (cd "..." && ...). This regresses the previous --working-directory=<dir> behavior by allowing expansions/substitutions in directory names (for example $VAR or $(...)), so a crafted or unusual project path can execute unintended commands or resolve to the wrong directory when resuming a session. Pass the working directory as a dedicated Ghostty argument (or apply shell-safe literal escaping) instead of embedding it in a shell command string.
Useful? React with 👍 / 👎.
Summary
cwdhandling matches other terminal integrationsTest plan
Closes #1975
🤖 Generated with Claude Code